package org.eenie.appseed.ui.boost

import com.idlefish.flutterboost.FlutterBoost
import com.idlefish.flutterboost.FlutterBoostRouteOptions

import org.eenie.appseed.databinding.ActivityFlutterBoostDemoBinding
import org.eenie.core.base.viewbinding.BaseBindingActivity
import org.eenie.core.ext.onClick


class FlutterBoostDemoActivity : BaseBindingActivity<ActivityFlutterBoostDemoBinding>() {


    override fun initUI() {
        this.binding.btnHome.onClick {
            val options = FlutterBoostRouteOptions.Builder()
                .pageName("/")
                .arguments(HashMap())
                .build()
            FlutterBoost.instance().open(options)

//
//            val intent: Intent = FlutterBoostActivity.CachedEngineIntentBuilder(VpFlutterActivity::class.java)
//                .backgroundMode(FlutterActivityLaunchConfigs.BackgroundMode.opaque)
//                .destroyEngineWithActivity(false)
//                .url("/")
//                .urlParams(hashMapOf())
//                .build(FlutterBoost.instance().currentActivity())
//            FlutterBoost.instance().currentActivity().startActivity(intent)

        }
    }

    override fun providerBinding() = ActivityFlutterBoostDemoBinding.inflate(layoutInflater)

}